<?
require("configClient.php");
require("class/databaseClass.php");
Database::connectDB();

$configClient = new ConfigClient();
define('PATH_CLASS', $configClient->pathClass);
require("configuration.php");
$configuration = new Configuration();
$page = true;
foreach($configuration->config() as $key => $value){
	if($key == $_GET["class"] && $_GET["function"] == "ajaxActionForm"){		
		require($key.".form.class.php");
		Form::setValidate();	
		if(Form::validateData(Form::$checkValidate)){
			Form::insertData();
		}		
		$page = false;
	}else if($key == $_GET["class"] && $_GET["function"] == "delete"){		
		require($key.".form.class.php");
		Form::deleteData();
		$page = false;
	}else{
		foreach($value as $key2 => $value2){
			if($key == $_GET["class"] && $key2 == $_GET["function"]){
				define('THIS_CLASS',$key);
				define('THIS_FUNCTION',$key2);
				define('PAGE_ACTION_FORM',$value2);
				require($value2);
				$page = false;
					//echo THIS_TAB;
			}
		}
	}
}
if($page)
	echo "error1";	

?>